import { http } from "@/utils/http";
import type { AxiosResultDefault, TableType } from "../type";

// 查询孪生体物模型信息
export const queryObjectModelList = (data: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/digitaltwins/api/v1/model/query`, { data }, { headers: { noLoading: false } });

// 设备总称和类型名称列表
export const queryCategoryTypeList = (data: object | undefined) =>
  http.request<AxiosResultDefault>(
    "post",
    `/digitaltwins/api/v1/equipmentCategory/queryCategoryTypeList`,
    { data },
    { headers: { noLoading: false } }
  );

// 保存孪生体物模型
export const saveObjectModel = (data: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/digitaltwins/api/v1/model/save`, { data }, { headers: { noLoading: false } });

// 获取孪生体物模型信息
export const getObjectModelInfo = (data: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/digitaltwins/api/v1/model/get`, { data }, { headers: { noLoading: false } });

// 查询孪生体物模型属性信息
export const queryObjectModelPropsInfo = (data: object | undefined) =>
  http.request<TableType>("post", `/digitaltwins/api/v1/model/attribute/query`, { data }, { headers: { noLoading: false } });

// 保存孪生体物模型属性
export const saveObjectModelPropsInfo = (data: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/digitaltwins/api/v1/model/attribute/save`, { data }, { headers: { noLoading: false } });

// 获取孪生体物模型属性信息
export const getObjectModelPropsInfo = (data: object | undefined) =>
  http.request<AxiosResultDefault>("post", `/digitaltwins/api/v1/model/attribute/get`, { data }, { headers: { noLoading: false } });

// 获取枚举数据接口
export const getObjectModelEnum = (params: object | undefined) =>
  http.request<AxiosResultDefault>("get", `/digitaltwins/api/v1/model/enum/query`, { params }, { headers: { noLoading: false } });
